<?php
function getImage($num) {
	global $more;
	$more = 1;
	$content = get_the_content();
	$count = substr_count($content, '<img');
	$start = 0;
	for($i=1;$i<=$count;$i++) {
		$imgBeg = strpos($content, '<img', $start);
		$post = substr($content, $imgBeg);
		$imgEnd = strpos($post, '>');
		$postOutput = substr($post, 0, $imgEnd+1);
		$image[$i] = $postOutput;
		$start=$imgEnd+1;  
		 
		$cleanF = strpos($image[$num],'src="')+5;
		$cleanB = strpos($image[$num],'"',$cleanF)-$cleanF;
		$imgThumb = substr($image[$num],$cleanF,$cleanB);
	 
	}
	if(stristr($image[$num],'<img')) { return $imgThumb; }
		$more = 0;
}
//retreive image ends

?>